package sany.iec.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author 托马斯
 * @Date 2025/7/6 16:07
 * @Description EnableEnum
 */
@AllArgsConstructor
@Getter
@ToString
public enum EnableEnum {

    Enabled("是", "启用服务|变更"),

    NotEnabled("否", "不启用服务|不变更");

    private final String flag;

    private final String description;

    public static EnableEnum getEnableEnum(String str) {
        if (StringUtils.isBlank(str)) {
            return NotEnabled;
        }
        for (EnableEnum enableEnum : EnableEnum.values()) {
            if (str.equals(enableEnum.getFlag())) {
                return enableEnum;
            }
        }
        return NotEnabled;
    }

}
